home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 50
/
Aminet 50 (2002)(GTI - Schatztruhe)[!][Aug 2002].iso
/
Aminet
/
dev
/
basic
/
BlitzLstMay02.lha
/
BlitzLstMay02
/
attachments
/
mail_54
/
kprintf.lha
/
kprintf.ab2
Wrap
Text File
|
2002-05-22
|
1KB
|
52 lines
Goto skip_kprintf
; Push arguments onto stack, last first
; !PUTSTR{id,"rawdofmt string"}
; Remove args from stack
; e.g.:
;.someroutine:
;CNIF #DEBUG=1
; PEA.l $DEADBEEF
; !PUTSTR{001,"Fiiiiiiist: $%lX"}
; LEA.l 4(a7),a7
;CEND
Macro PUTSTR
MOVEM.l d0-d1/a0-a1,-(a7)
LEA.l 'msg_`1(pc),a0
LEA.l 4*4(a7),a1
JSR dboutput
MOVEM.l (a7)+,d0-d1/a0-a1
BRA 'skip_`1
'msg_`1: Dc.b `2,10,0 : Even
'skip_`1:
End Macro
#_LVORawPutChar = -516 ; Send one character in d0:7-0 to the serial port
#_LVORawDoFmt = -522 ; formats and completes string like printf
.Internals
; Debugging code
; a0 = pointer to format string
; a1 = pointer to arguments
dboutput:
MOVEM.l d0-d1/a0-a3/a6,-(a7)
MOVE.l 4,a6 ; Pointer to execbase
LEA 'KPutChar(pc),a2 ; Pointer to the routine for dumping chars called by RawDoFmt
SUB.l a3,a3 ; Clear a3
JSR _LVORawDoFmt(a6) ; Call exec.library/RawDoFmt()
MOVEM.l (a7)+,d0-d1/a0-a3/a6
RTS
'KPutChar:
MOVE.l a6,-(a7)
MOVE.l 4,a6 ; execbase
JSR _LVORawPutChar(a6) ; print character in d0:7-0 to ser:
MOVE.l (a7)+,a6
RTS
skip_kprintf:
ClickMouse
End